package top.hzy520.Controller;

import top.hzy520.entity.User;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


public class GetRealNameServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       User user= (User) req.getSession().getAttribute("user");
        PrintWriter writer=resp.getWriter();
        writer.print(user.getRealname());
    }
}
